$(document).ready(function() {
	$('#nav a[href~="' + location.href + '"]').parents('li').addClass('active');
});

/* ---------------------------------------------------------------------- */
/*	Scroll
/* ---------------------------------------------------------------------- */
(function($){
	$(window).load(function(){
		$("#content-1").mCustomScrollbar({
			axis:"x",
			theme:"dark-thin",
			autoHideScrollbar:true,
			advanced:{autoExpandHorizontalScroll:true}
		});
		$("#client").mCustomScrollbar({
			axis:"x",
			theme:"rounded-dark",
			advanced:{autoExpandHorizontalScroll:true}
		});
		$("#team").mCustomScrollbar({
			axis:"y",
			theme:"rounded-dark",
			advanced:{autoExpandHorizontalScroll:true}
		});
		$(".g_image").mCustomScrollbar({
			axis:"y",
			autoHideScrollbar:true,
			theme:"rounded-dark",
			advanced:{autoExpandHorizontalScroll:true}
		});

	});
})(jQuery);


//CALL TESTIMONIAL ROTATOR
$( function() {
	/*
	- how to call the plugin:
	$( selector ).cbpQTRotator( [options] );
	- options:
	{
		// default transition speed (ms)
		speed : 700,
		// default transition easing
		easing : 'ease',
		// rotator interval (ms)
		interval : 8000
	}
	- destroy:
	$( selector ).cbpQTRotator( 'destroy' );
	*/
	$( '#cbp-qtrotator' ).cbpQTRotator();
});


//CALL PRETTY PHOTO
$(document).ready(function(){
	$("a[data-gal^='prettyPhoto']").prettyPhoto({social_tools:'', animation_speed: 'normal' , theme: 'dark_rounded'});
});

//MASONRY
$(document).ready(function(){
	var $container = $('#content');
  $container.imagesLoaded( function(){
		$container.isotope({
			filter: '*',	
			animationOptions: {
			 duration: 750,
			 easing: 'linear',
			 queue: false,	 
		   }
		});
	});
	$('#filter a').click(function (event) {
		$('a.selected').removeClass('selected');
		var $this = $(this);
		$this.addClass('selected');
		var selector = $this.attr('data-filter');
			$container.isotope({
				 filter: selector
			});
		return false;
	});
});

$(document).ready(function() {
	$(".fancybox").fancybox();
});

$(function() {
	$(".roll").css("opacity","0");
	$(".roll").hover(function () {
	$(this).stop().animate({
	opacity: .8
	}, "slow");
	},
	function () {
	$(this).stop().animate({
	opacity: 0
	}, "slow");
	});
	});
	$('#myTab a').click(function (e) {
	e.preventDefault()
	$(this).tab('show')
	});

$('.ajax-popup-link').magnificPopup({
  type: 'ajax'
});

$(function() {
	
// Support for AJAX loaded modal window.
// Focuses on first input textbox after it loads the window.
$('[data-toggle="modal"]').click(function(e) {
	e.preventDefault();
	var url = $(this).attr('href');
	if (url.indexOf('#') == 0) {
		$(url).modal('open');
	} else {
		$.get(url, function(data) {
			$('<div class="modal hide fade">' + data + '</div>').modal();
		}).success(function() { $('input:text:visible:first').focus(); });
	}
});
	
});


